#ifndef _PROJECTO_C
#define _PROJECTO_C
/**********************************
 * Library to make use in project
 * This libray keeps the main structure to associate with Not Teminal Symbols
 *
 * @author Jorge Machado
 * @date 12-12-2008
 *
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "listas.h"
#include "vm.h"
#include "projecto.h"


char * retornaId(char * identificador)
{
	char * copia = (char*) malloc(sizeof(strlen(identificador)+1));
	strcpy(copia, identificador);
	return copia;
}

CodePlaceNode * createNewCodePlaceNode()
{
	CodePlaceNode * codePlaceNode = (CodePlaceNode*) malloc(sizeof(CodePlaceNode));	
	codePlaceNode->code = NULL;
	codePlaceNode->place = NULL;
	return codePlaceNode;
}

struct NotTerminalSymbol_Struct * createNotTerminalSymbol_Struct()
{
	struct NotTerminalSymbol_Struct* notT = (struct NotTerminalSymbol_Struct*) malloc(sizeof(struct NotTerminalSymbol_Struct ));
	notT->codePlaceNode = NULL;
	notT->logicalExpressionNode = NULL;
	notT->sValue[0] = '\0';
	notT->idValue[0] = '\0';
	return notT;
}

LogicalExpressionNode * createNewLogicalExpressionNode()
{
    LogicalExpressionNode * logicalExpressionNode = (LogicalExpressionNode*) malloc(sizeof(LogicalExpressionNode));	
	logicalExpressionNode->trueC3ops = NULL;
	logicalExpressionNode->falseC3ops = NULL;
	return logicalExpressionNode;
}
#else
/* code to include if the token is defined */
#endif


